/*  This file is part of LibGChart.
 *
 * AUTHORS
 *       Sascha Dewald        <sascha.dewald@googlemail.com>
 *
 * Copyright (C) 2009 Sascha Dewald
 *
 *  
 *  
 *  LibGChart is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Foobar is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with LibGChart.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;
using Gtk;

using LibGChart;

namespace TestChart {

	/**
	 * MainWindow
	 */
	public partial class MainWindow: Gtk.Window
	{
		private GSeries mySeries;
		
		private ConfigWindow winConfig;
		
		/** 
		 * Constructor
		 */
		public MainWindow (): base (Gtk.WindowType.Toplevel)
		{
			Build ();
			
			winConfig = new ConfigWindow(gchartMain);
			winConfig.Show();
			
			
			Console.WriteLine("*******AddMessung**********");
			mySeries = new GSeries("Messung 1");
			mySeries.Add(new GPoint(0, 0));
			mySeries.Add(new GPoint(50, 2));
			mySeries.Add(new GPoint(80, 5));
			mySeries.Add(new GPoint(240, 17));
			mySeries.Add(new GPoint(500, 20));
			
			gchartMain.SeriesList.Add(mySeries);
			
			mySeries = new GSeries("Messung 2");
			mySeries.Add(new GPoint(5, 10));
			mySeries.Add(new GPoint(10, 50));
			mySeries.Add(new GPoint(50, 18));
			mySeries.Add(new GPoint(240, 17));
			mySeries.Add(new GPoint(400, 5));
			
			gchartMain.SeriesList.Add(mySeries);
			
			mySeries.set_color(0.0, 0.0, 1.0);
		}
		
		
		/**
		 * OnDeleteEvent will be raised, when the application close
		 */
		protected void OnDeleteEvent (object sender, DeleteEventArgs a)
		{
			Application.Quit ();
			a.RetVal = true;
		}
		
		/**
		 * OnQuitActionActivated will be raised, when the Quit-Action a called
		 */
		protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
		{
			System.Console.WriteLine("Quit Pressed.");
		}
	
	
		/**
		 * OnBeendenActionActivated event
		 */
		protected virtual void OnBeendenActionActivated (object sender, System.EventArgs e)
		{
			Application.Quit();
		}
		
	}
	
}